80154: xfi:decimals

Documentation

Test the functionality of the xfi:decimals function. Suggested conversion from precision to decimals: If precision is INF, decimals is INF. If fraction, decimals is INF. If non-zero precision is reported then decimals is (precision - (floor(log10(value)) + 1)). If precision 0 is reported, decimals can't really be specified, so there is no clearly correct decimals, but it has been suggested to report INF and allow formulas to execute. (An "unfriendly" alternate may be to raise an exception. There is no variation to test precision 0 as it has no meaningful decimals representation.)

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 06-04-2008 at 12:12:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670664

Test Case Variations


V-01 Returns error for a non-numeric concept

Documentation

The concept has an xbrli:stringItemType data type.

Inputs

Outputs

  • Error code: xfie:ItemIsNotNumeric

V-02 Decimals is 0 for 400, reported as decimals 0

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:integer and $result eq 0

V-03 Decimals is INF for 400, reported as decimals INF

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:string and $result eq 'INF'

V-04 Decimals is -2 for 4e2, reported as decimals -2

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:integer and $result eq -2

V-05 Decimals is 1 for 400, reported as precision 4.

Documentation

Formula is decimals = (precision - (floor(log10(value)) + 1)) = (4 - (floor(2.6)+1)) = (4 - 3) = 1.

Inputs

Outputs

  • Result test: $result instance of xs:integer and $result eq 1

V-06 Returns INF for a fraction concept

Documentation

The concept has an xs:fractionItemType data type.

Inputs

Outputs

  • Result test: $result instance of xs:string and $result eq 'INF'

V-07 Returns error for a tuple concept

Documentation

The concept is a tuple.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

Revisions

Name On Details
Herm Fischer 06-04-2008 at 12:12:00 Created the test case.
Herm Fischer 22-06-2011 at 00:00:00 Added xmlns:xs.